home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Barras de herramientas y barras de estado / SimpleStatusBarWithPanel / SimpleStatusBarWithPanel.cs next >
Encoding:
Text File  |  2002-06-26  |  1.5 KB  |  48 lines

  1. //-------------------------------------------------------
  2. // SimpleStatusBarWithPanel.cs ⌐ 2001 by Charles Petzold
  3. //-------------------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class SimpleStatusBarWithPanel: Form
  9. {
  10.      public static void Main()
  11.      {
  12.           Application.Run(new SimpleStatusBarWithPanel());
  13.      }
  14.      public SimpleStatusBarWithPanel()
  15.      {
  16.           Text = "Barra de estado simple con un panel";
  17.  
  18.                // Crea un panel.
  19.  
  20.           Panel panel = new Panel();
  21.           panel.Parent = this;
  22.           panel.BackColor = SystemColors.Window;
  23.           panel.ForeColor = SystemColors.WindowText;
  24.           panel.AutoScroll = true;
  25.           panel.Dock = DockStyle.Fill;
  26.           panel.BorderStyle = BorderStyle.Fixed3D;
  27.  
  28.                // Crea una barra de estado como control secundario del formulario.
  29.  
  30.           StatusBar sb = new StatusBar();
  31.           sb.Parent = this;
  32.           sb.Text = "Mi primer texto en la barra de estado";
  33.  
  34.                // Crea etiquetas como controles secundarios del panel.
  35.  
  36.           Label label = new Label();
  37.           label.Parent = panel;
  38.           label.Text = "Superior izquierda";
  39.           label.Location = new Point(0, 0);
  40.  
  41.           label = new Label();
  42.           label.Parent = panel;
  43.           label.Text = "Inferior derecha";
  44.           label.Location = new Point(250, 250);
  45.           label.AutoSize = true;
  46.      }
  47. }
  48.